﻿package com.zouloux.medias 
{
	import flash.events.EventDispatcher;
	
	/**
	 * ...
	 * @author ZoulouX
	 */
	public class AMediaController extends EventDispatcher implements IMediaController
	{
		// Les variables d'état
		protected var _paused				:Boolean 	= true;
		protected var _playing				:Boolean 	= false;
		protected var _time					:Number 	= 0;
		
		// Le nombre de boucles à effecter
		protected var _loop					:uint 		= 0;
		
		// Les getters
		public function get paused()	:Boolean 	{ return _paused; }
		public function get playing()	:Boolean 	{ return _playing; }
		public function get time()		:Number 	{ return _time; }
		public function get loop()		:uint 		{ return _loop; }
		public function get volume()	:Number 	{ return 0; }
		
		// Les setters
		public function set paused(value:Boolean):void 
		{
			_paused = value;
		}
		public function set playing(value:Boolean):void 
		{
			_playing = value;
		}
		public function set time(value:Number):void 
		{
			_time = value;
		}
		public function set loop(value:uint):void 
		{
			_loop = value;
		}
		public function set volume(value:Number):void 
		{
			throw new Error("Don't instanciate an abstract class");
		}
		
		
		public function load (pUrl:String, pAutoStart:Boolean = false):void
		{
			throw new Error("Don't instanciate an abstract class");
		}
		
		public function play (pAt:Number = -1, pLoop:uint = 0):void
		{
			throw new Error("Don't instanciate an abstract class");
		}
		
		public function stop ():void
		{
			throw new Error("Don't instanciate an abstract class");
		}
		
		public function pause (pValue:Boolean = true):void
		{
			throw new Error("Don't instanciate an abstract class");
		}
		
		public function seek (pAt:Number):void
		{
			throw new Error("Don't instanciate an abstract class");
		}
		
		public function close (pCloseConnection:Boolean = true):void
		{
			throw new Error("Don't instanciate an abstract class");
		}
	}
}